package com.zx.erp.sys.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zx.erp.sys.bean.Job;
import com.zx.erp.sys.mapper.JobMapper;
import com.zx.erp.sys.service.JobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 作者信息
 * @since 2021-11-10
 */
@Service
public class JobServiceImpl extends ServiceImpl<JobMapper, Job> implements JobService {
    @Autowired
    private JobMapper mapper;

    @Override
    public Page<Job> findByPage(Job job, Integer pageNo, Integer pageSize) {
        // Step1：创建一个 Page 对象
        Page<Job> page = new Page<Job>(pageNo, pageSize);
        // Step2：调用 mybatis-plus 提供的分页查询方法
        Page<Job> pageInfo = mapper.findAll(page, job);

        return pageInfo;
    }
    @Override
    public List<Job> findAll(Job job) {
        return mapper.findAll(job);
    }
}
